/**
 *
 * 版权所有 © cybersky.com
 *
 */
package cn.cybertron.primus.report.data;

import java.util.List;

/**
 * 记录默认实现类
 * @author ch
 *
 */
public class DefaultReportDataRecord implements ReportDataRecord {

	private static final long serialVersionUID = 292295817223482937L;

	/**
	 * 数据项值
	 */
	protected List<Object> record;
	
	public DefaultReportDataRecord() {

	}
	
	public List<Object> getRecord() {
		return record;
	}

	public void setRecord(List<Object> record) {
		this.record = record;
	}

	@Override
	public Object getItem(int index) {
		if(record != null && index >= 0 && index < record.size())
		{
			return record.get(index);
		}
		return null;
	}

	@Override
	public void setItem(int index, Object value) {
		if(record != null && index >= 0 && index < record.size()) {
			record.set(index, value);
		}
	}

	@Override
	public boolean isNull() {
		if(record != null && record.size() > 0) {
			for(Object obj: record){
				if (obj == null)
					return true;
			}
			return false;
		}
		return true;
	}

}
